<?php
    $libraryID = $_GET['location'];
    require('db_connection.php');
    $query2 = "SELECT * FROM tbllibrary WHERE libraryNo LIKE '$libraryID'";
    $result2 = mysql_query($query2);
    while($row=mysql_fetch_array($result2))
    {
      $libraryName = $row['libraryName'];
      $description = $row['description'];
      $imgfilename = $row['imgfilename'];
    }
?>
<!doctype html public "-//W3C//DTD HTML 4.01//EN">

<html>

   <head>
      <title>La Union Online Library System -- Library Profile</title>
      <meta http-equiv='generator' content='PHP Designer 2005' />
      <style type="text/css">
        @import url(style.css);
      </style>
   </head>
   <body>
        <table  width='80%' align='center' cellspacing='0' cellpadding='0'>
            <tr ><td class='outerframe'>
                <table width='100%'>
                <tr>
                    <td width='100%' colspan='2' >
                    <img src ='images/banner.jpg'></td></tr>
                <tr>
                    <td colspan='2' class='login'><?php require('loginout.php'); ?></td></tr>
                <tr>
                    <td width='20%' class='menu' valign='top'><?php require('menu.php'); ?></td>
                    <td class='content' width='80%' background ='images/background.jpg'>
                        <table align='center' width='100%'><form method='get' action='profile.php'>
                            <tr><td class='librarysearch' width='100%'>Select a Library:
                                <select name='location'>
                                <option selected='selected' value=''>- - -Choose Library- - -</option>
                                 <?php
                                    $library = $_GET['location'];
                                    $query="SELECT * FROM tbllibrary";
                                    $result = mysql_query($query);
                                    while ($row = mysql_fetch_array($result))
                                    {
                                        $libraryNo = $row['libraryNo'];
                                        $location = $row['libraryName'];
                                        echo"<option value=$libraryNo>"." $location "." ";
                                    }
                                    //select the choosen library and display the description
                                    echo $location;

                                    $query1 = "SELECT * FROM tbllibrary WHERE libraryNo like '$libraryID'";
                                    $result1 = mysql_query($query1);
                                    while ($row = mysql_fetch_array($result1))
                                    {
                                        $libraryName = $row['libraryName'];
                                        $description = $row['description'];
                                        $imgfilename = $row['imgfilename'];
                                    }

                                 ?>
                                    </select>
                                    <input type='submit' value='  OK  ' class='tool'></td>
                            </tr>
                           
                        </form>
                        <?php
                            echo "<tr><td class='libraryname'colspan='3'>"."$libraryName"."</td></tr>";
                            echo"<tr><td colspan='3' align='center'><img src='admin/images/library/$imgfilename' class='librarypic' alt=''></td></tr>";
                            ?>
                        <tr> <td colspan='2' class='librarydes'><?php echo $description; ?></td></tr>
                        </table></td></tr>
                    
                <tr>
                <td colspan='2' class='outerframe2'><?php require('contact.php'); ?></td></tr>
                </table>
        </td></tr></table>
    </body>
</html>




